/**
 * Created by 游永年 on 2019-01-12 01:42.
 * 首页两个按钮
 */
'use strict'
import {Button, Flex, WhiteSpace} from 'antd-mobile';
import React, {Component} from 'react';
import style from './user.less';
import {connect} from 'dva';

class TwoButton extends Component {
  render() {
    return (
      <div>
        <h2 style={{borderBottom: '1px solid #ccc'}}>个人信息</h2>
        <WhiteSpace/>
        <Flex justify={"around"} align={'stretch'} style={{height: '50px'}}>
          <Button type="primary" className={style.leftBtn} onClick={this.orderList}>我的订单</Button>
          <Button type="warning" className={style.rightBtn}>人工课服</Button>
        </Flex>
      </div>
    );
  }

  orderList = _ => {
    const {history, dispatch} = this.props;
    dispatch({type: 'user/fetchOrderList'});
    history.push('/user/orderList');
  }
}

TwoButton.propTypes = {}
export default connect()(TwoButton);
